package com.neepu.serviceImpl;

import com.neepu.dao.MessageBoardMapper;
import com.neepu.pojo.MessageBoard;
import com.neepu.service.MessageBoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional(propagation= Propagation.REQUIRED,isolation= Isolation.DEFAULT)
@Service("MessageBoardService")
public class MessageBoardServiceImpl implements MessageBoardService {

    @Autowired
    private MessageBoardMapper messageBoardMapper;

    @Override
    public void addMessageBoard(MessageBoard messageBoard) {
        messageBoardMapper.addMessageBoard(messageBoard);
    }

    @Override
    public List<MessageBoard> getAllMessage() {
        return messageBoardMapper.getAllMessage();
    }
}
